<template>
    <p>初始message:{{message}}</p>
    <p>反转后的message:{{reversemessage}}</p>
    <button @click="update">更改</button>
</template>

<script setup> 

import {ref,computed} from 'vue'
const message=ref('hello world')
const reversemessage=computed(()=>
    //字符串翻转
    message.value.split('').reverse().join('')
)
const update=(()=>{
    message.value='hello'
})

</script>